<template>
 <div class="containers">
    <div class="container">
      <div class="form-box" style="width: 100%;max-width: 900px;">
        <el-tabs>
          <el-tab-pane label="修改密码" >
            <el-form ref="form" label-width="120px">
              <el-form-item label="原密码">
                <el-input v-model="password" placeholder="请输入原密码"></el-input>
              </el-form-item>
              <el-form-item label="新密码">
                <el-input v-model="re_password" placeholder="请输入新密码"></el-input>
              </el-form-item>
              <el-form-item label="确认新密码">
                <el-input v-model="new_password" placeholder="请确认密码"></el-input>
              </el-form-item>
            </el-form>
          </el-tab-pane>
        </el-tabs>
       <el-button type="primary" @click="load">确认修改</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
    name: 'modifyPassword',

    data() {
        return {
            password:'',         //原密码
            re_password:'',      //新密码
            new_password:'',     //确认新密码
        };
    },

    mounted() {
        
    },

    methods: {
        load() {
            this.request('admin/modifyPassword/', 'POST', {password:this.password,re_password:this.re_password,new_password:this.new_password}).then(
                res => {
                    this.password = ''
                    this.re_password = ''
                    this.new_password = ''
                if (res.errno == 0) {
                    // this.form = res.data
                    this.$message.success(res.errmsg);
                    }else{
                        this.$message.error(res.errmsg);
                    }
                },
                function () {
                console.log('请求失败处理');
                }
            );
        },
    },
};
</script>

<style lang="scss" scoped>

</style>
